<template>
  <ComGroup title="生效时间">
    <el-date-picker v-model="dataArray" size="mini" type="daterange"
                    format="yyyy-MM-dd" start-placeholde="开始时间" end-placeholde="结束时间"
    />
  </ComGroup>
</template>

<script>
import ComGroup from '@/components/BasicUi/ComGroup'
export default {
  name: 'ComValidTime',
  components: {
    ComGroup
  },
  props: {
    value: {
      type: Array,
      default: null
    }
  },
  data() {
    return {
    }
  },
  computed: {
    dataArray: {
      get() {
        return this.value
      },
      set(v) {
        let newDate = v ? [v[0].getTime(), v[1].getTime()] : []
        this.$emit('input', newDate)
      }
    }
  }
}
</script>

<style scoped lang="less">
    /deep/.el-date-editor{
        width: 100% !important;
    }
</style>
